home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr46 / be310.zip / SIDEBY.CHS < prev    next >
Text File  |  1993-06-01  |  2KB  |  64 lines

  1. /* CHESS FUNCTION(S): double_down, double_up
  2. /*              DATE: 3/1/93
  3. /*            AUTHOR: C. Schanck
  4. /*
  5. /*       DESCRIPTION:
  6. /* This is a pair of functions which can be attached to your pgup and
  7. /* pgdn keys and will give you some different functionality.
  8. /*           
  9. /* In either case, pressing the key within a full, non-verically-split
  10. /* window will cause the keys to behave normally.  If the window has
  11. /* a right or left neighbor however, the two windows will be scrolled
  12. /* together, side-by-side!    Enjoy!
  13. /*
  14. double_down{       
  15.    int i;
  16.    if(ask("file_w_width")!=ask("sys_cols)){
  17.       /* boom! we have to do both
  18.       if(ask("file_w_left")==1){
  19.          /* here we are in the left one, must do the right as well
  20.          i=b_cmd("down_page");
  21.          i=i+b_cmd("window_next");
  22.          i=i+b_cmd("down_page");
  23.          i=i+b_cmd("window_prev");
  24.       }
  25.       else{
  26.          /* here we are in the right one, must do the left as well
  27.          i=b_cmd("down_page");
  28.          i=i+b_cmd("window_prev");
  29.          i=i+b_cmd("down_page");
  30.          i=i+b_cmd("window_next");
  31.       }      
  32.       if(i!=4)
  33.          i=0
  34.    }          
  35.    else{
  36.       /* behave normally here
  37.       i=b_cmd("down_page");
  38.    }
  39.    return(i);
  40. }
  41. double_up{   
  42.    int i;
  43.    if(ask("file_w_width")!=ask("sys_cols)){
  44.       /* boom! we have to do both
  45.       if(ask("file_w_left")==1){
  46.          i=b_cmd("up_page");
  47.          i=i+b_cmd("window_next");
  48.          i=i+b_cmd("down_page");
  49.          i=i+b_cmd("window_prev");
  50.       }
  51.       else{
  52.          i=b_cmd("up_page");
  53.          i=i+b_cmd("window_prev");
  54.          i=i+b_cmd("down_page");
  55.          i=i+b_cmd("window_next");
  56.       }
  57.       if(i!=4)
  58.          i=0;
  59.    }          
  60.    else{
  61.       i=b_cmd("down_page");
  62.    }
  63.    return(i);
  64. }